how to use charAt method